<?php
header ("Content-Type:text/html; charset= utf-8");
require_once ('config.php');
if(empty($_GET['type'])){
	echo "forbidden";
	exit;
}
$type=$_GET['type'];
switch ($type)
{
	case 'tel':
		$title="办公室电话";
		break;
	case 'recruit':
		$title="人员招聘";
		break;
	default:
		echo "forbidden!";
		exit();
}
$smarty->assign("title",$title);

$filename=WEBSITEURL."/".ADMINLOC."/data/default/$type.txt";
if(!file_exists($filename)){
	echo "forbidden";
	exit();
}
$info=file_get_contents($filename);
$smarty->assign("info",$info);

$system=new System();
$sys_style=$system->getSysStyle();
$channel_model=WEBSITEURL."/templates/$sys_style/channel/contact.htm";

if(!file_exists($channel_model))
{
	echo "模版文件丢失";
	exit;
};
$smarty->template_dir=WEBSITEURL."/templates/$sys_style/channel";
$smarty->assign("template_dir","templates/$sys_style");
$smarty->display($channel_model,md5("contact.php?type=$type"));